package com.zx.template.controller.wx;

import com.zx.template.base.ValidationGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@ApiModel(description = "订单支付入参")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class PayDto {

    /**套餐id*/
    @ApiModelProperty("套餐id")
    @NotNull(message = "套餐id 不能为空",groups = {ValidationGroup.Add.class})

    private Long productId;
    /**
     * 实付价格
     */
    @ApiModelProperty("订单实付金额价格")
    @NotNull(message = "订单实付金额价格 不能为空",groups = {ValidationGroup.Add.class})
    @Min(value = 0,message = "订单实付金额价格 不能小于0",groups = {ValidationGroup.Add.class})
    private BigDecimal realPrice;

    @ApiModelProperty("附加数据")
    @Length(max = 127,message = "附加数据 不能超过127 字符",groups = {ValidationGroup.Add.class})
    private String attach;

    @ApiModelProperty(" 商品描述")
    @NotBlank(message = "商品描述 不能为空 ",groups = {ValidationGroup.Add.class})
    @Length(max = 127,message = "商品描述 不能超过127 字符",groups = {ValidationGroup.Add.class})
    private String body;
}